<?
	session_start();
	include('conn.php');

	$cid = $_REQUEST['cid'];
	$amt = $_REQUEST['amt'];

	$q1 = "select phoneno,custdesc from customermast where custid='$cid'";
	$r1 = mysql_query($q1);
	echo $q1.$r1;
	$row = mysql_fetch_array($r1);
	$rcv = $row['custdesc'];
	$phs = $row['phoneno'];
	
	$ph = explode(",",$phs);
	
	for($j=0; $j< sizeof($ph); $j++)
	{
		if($j == 0)
			$phlist = $ph[$j];
		else
			$phlist=$phlist.",".$ph[$j];	
		//echo "<br>".$phlist;				
	}	
	$template1 = "Dear $rcv, Your total outstanding with SHREE COMMUNICATION as on date is Rs. $amt. Pls ignore if already paid. Thank You.";
	$template2 = "Dear $rcv, We have received your payment of Rs. $amt. Credit will be subject to realization of cheque. Thank You.";
	$sql = "http://sms6.routesms.com:8080/bulksms/bulksms?username=shreetrac&password=shre8786&type=0&dlr=1&destination=$phlist&source=SHREEE&message=$template2";
	echo $sql;	
?>